import { getAreaObj, regularRule, uploadType } from '@/utils/util'
import { toSearchHandle, configToSearch, configToReserveSearch } from '@/views/datacenter/basicData/utils/index'

// 基础
export const BaseFormConfig = {
	inline: false,
	showBtn: false,
	labelPosition: 'top',
	column: [
		{
			uploadTip: '员工照片',
			prop: 'staffPhoto',
			type: 'upload',
			showFileList: false,
			limit: 1,
			multiple: false,
			span: 12,
			viewDisplay: false,
			rules: [{ required: true, message: '请上传员工照片' }],
		},
		{
			uploadTip: '工牌照片',
			prop: 'workCardPhoto',
			type: 'upload',
			showFileList: false,
			limit: 1,
			multiple: false,
			span: 12,
			viewDisplay: false,
		},
		{ label: '出生日期', prop: 'birthday', span: 8, formDisplay: true },
		{
			label: '从业人员姓名',
			prop: 'practitionersName',
			maxlength: '20',
			changeField: true,
			showWordLimit: true,
			type: 'text',
			viewDisplay: false,
			rules: [{ required: true, message: '请输入从业人员姓名' }],
			span: 8,
		},
		{
			label: '联系方式',
			prop: 'phone',
			maxlength: '11',
			changeField: true,
			showWordLimit: true,
			rules: [{ required: true, message: '请输入联系方式' }],
			type: 'text',
			span: 8,
			viewDisplay: false,
		},

		// {
		// 	label: '文化程度',
		// 	prop: 'cultureDegree',
		// 	propName: 'cultureDegreeLabel',
		// 	type: 'remoteSelect',
		// 	code: 'EDUCATION_DEGREE',
		// 	api: 'getDictItemList',
		// 	filterKey: 'value',
		// 	multiple: false,
		// 	rules: [{ required: true, message: '请选择文化程度' }],
		// 	span: 8,
		// },
		{
			label: '证件类型',
			prop: 'certificateType',
			propName: 'certificateTypeLabel',
			type: 'remoteSelect',
			code: 'ID_CARD_TYPE',
			api: 'getDictItemList',
			filterKey: 'value',
			changeField: true,
			multiple: false,
			span: 8,
			rules: [{ required: true, message: '请选择证件类型' }],
		},

		{
			label: '证件号码',
			prop: 'idCard',
			maxlength: '18',
			changeField: true,
			showWordLimit: true,
			editDisabled: true,
			type: 'text',
			rules: [{ required: true, message: '请输入证件号码' }],
			span: 8,
		},
		{
			label: '户籍地区',
			prop: 'crAreas',
			propName: 'crAreasName',
			propOther: 'crZoningCode',
			type: 'AplidAreaSelect',
			rules: [{ required: true, message: '请选择户籍地区' }],
			span: 8,
		},
		{
			label: '户籍地行政区划代码',
			prop: 'crZoningCode',
			type: 'text',
			maxlength: '12',
			showWordLimit: true,
			disabled: true,
			// rules: [{ validator: regularRule.areaCode, message: '请输入正确的户籍地行政区划代码' }],
			span: 8,
		},
		{
			label: '户籍地邮政编码',
			prop: 'postalCode',
			type: 'text',
			maxlength: '6',
			showWordLimit: true,
			rules: [{ validator: regularRule.postalCode, message: '请输入正确的户籍地邮政编码' }],
			span: 8,
		},

		{
			label: '户籍地址',
			prop: 'crAddress',
			maxlength: '140',
			showWordLimit: true,
			type: 'text',
			span: 8,
			rules: [{ required: true, message: '请输入户籍地址' }],
		},
		{
			label: '现居地区',
			prop: 'areas',
			propName: 'areasName',
			type: 'AplidAreaSelect',
			rules: [{ required: true, message: '请选择现居地区' }],
			span: 8,
		},
		{
			label: '现居地址',
			prop: 'address',
			maxlength: '140',
			showWordLimit: true,
			type: 'text',
			span: 8,
			rules: [{ required: true, message: '请输入现居地址' }],
		},
		{
			label: '民族',
			prop: 'national',
			propName: 'nationalLabel',
			type: 'remoteSelect',
			code: 'NATIONALITY',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},
		{
			label: '政治面貌',
			prop: 'politicsAspect',
			propName: 'politicsAspectLabel',
			type: 'remoteSelect',
			code: 'POLITICAL_STATUS',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},

		{
			label: '婚姻状况',
			prop: 'maritalStatusDict',
			propName: 'maritalStatusDictLabel',
			type: 'remoteSelect',
			code: 'MARITAL_STATUS',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},
		{
			label: '职业类型',
			prop: 'occupationType',
			propName: 'occupationTypeLabel',
			type: 'remoteSelect',
			code: 'OCCUPATION_TYPE',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: true,
			rules: [{ required: true, message: '请选择职业类型' }],
			span: 8,
		},
		{
			label: '岗位类型',
			prop: 'positionType',
			propName: 'positionTypeLabel',
			type: 'remoteSelect',
			code: 'POSITION_TYPE',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			changeField: false,
			control: (e) => {
				return {
					nameOfOtherJobTypes: {
						display: e == 5,
					},
					proofTip: {
						display: e != 5,
					},
					proofImg: {
						display: e != 5,
					},
					proofIssueUnitName: {
						display: e != 5,
					},
					proofType: {
						display: e != 5,
					},
					maturityTime: {
						display: e != 5,
					},
				}
			},
			span: 8,
		},
		{
			label: '其他岗位类型名称',
			prop: 'nameOfOtherJobTypes',
			maxlength: '140',
			showWordLimit: true,
			type: 'text',
			span: 8,
		},
		{
			label: '服务状态',
			prop: 'serviceState',
			propName: 'serviceStateLabel',
			type: 'remoteSelect',
			code: 'SERVICE_STATE',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			changeField: true,
			// rules: [{ required: true, message: '请选择服务状态' }],
			span: 8,
		},

		// {
		// 	label: '职业类型说明',
		// 	prop: 'occupationTypeDescription',
		// 	maxlength: '50',
		// 	showWordLimit: true,
		// 	type: 'text',
		// 	span: 8,
		// },
		// {
		// 	label: '健康状态',
		// 	prop: 'healthyState',
		// 	propName: 'healthyStateLabel',
		// 	type: 'remoteSelect',
		// 	code: 'HEALTHY_STATE',
		// 	api: 'getDictItemList',
		// 	filterKey: 'value',
		// 	multiple: false,
		// 	span: 8,
		// },
		{
			label: '工作类型',
			prop: 'workType',
			propName: 'workTypeLabel',
			type: 'remoteSelect',
			code: 'WORK_TYPE',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			changeField: true,
			// rules: [{ required: true, message: '请选择工作类型' }],
			span: 8,
		},
		{
			label: '开户银行',
			prop: 'bank',
			span: 8,
		},
		{
			label: '银行卡号',
			prop: 'bankCard',
			span: 8,
		},

		//--------------------社保缴纳情况 ----------------
		{
			type: 'DividerHtml',
			modelValue: '社保缴纳情况',
			labelPosition: 'top',
			span: 24,
		},
		{
			label: '是否缴纳社保',
			prop: 'paySocialInsurance',
			propName: 'paySocialInsuranceLabel',
			type: 'remoteSelect',
			code: 'COMMON_FLAG',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			rules: [{ required: true, message: '请选择是否缴纳社保' }],
			control: (e, model) => {
				return {
					cardNumber: {
						display: e == 1,
					},
					socialSecurityDate: {
						display: e == 1,
					},
					payProof: {
						display: e == 1,
					},
					socialInsuranceStartDate: {
						display: e == 1,
					},
					isSocial: {
						display: e == 1,
					},
				}
			},
			span: 8,
		},
		{
			label: '社保卡号',
			prop: 'cardNumber',
			maxlength: '50',
			showWordLimit: true,
			type: 'text',
			span: 8,
		},
		{
			label: '社保缴纳单位首先选择是否是本单位',
			prop: 'isSocial',
			propName: 'isSocialLabel',
			type: 'remoteSelect',
			code: 'COMMON_FLAG',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			control: (e, model) => {
				return {
					socialSecurityUnitName: {
						display: e == 0,
					},
				}
			},
			change: (item, form, value) => {
				if (value == 1) {
					form.socialSecurityUnitName = form.unitName
				} else {
					form.socialSecurityUnitName = ''
				}
			},
			span: 8,
		},
		{
			label: '社保单位',
			prop: 'socialSecurityUnitName',
			showWordLimit: true,
			type: 'text',
			span: 8,
		},
		{
			label: '连续缴纳社保开始日期',
			prop: 'socialInsuranceStartDate',
			type: 'date',
			format: 'YYYY年MM月DD日',
			valueFormat: 'YYYY-MM-DD',
			rules: [{ required: true, message: '请选择开始时间' }],
			span: 8,
		},
		{
			label: '社保缴费证明(满一年)',
			tip: '不满一年不上传',
			prop: 'payProof',
			type: 'upload',
			fileType: uploadType.fileMetaType,
			listType: 'text',
			labelPosition: 'top',
			showFileList: true,
			limit: 4,
			multiple: true,
			custome: 'file',
			span: 24,
		},
		//--------------------劳务派遣 ----------------
		// {
		// 	type: 'DividerHtml',
		// 	modelValue: '劳务派遣',
		// 	labelPosition: 'top',
		// 	span: 24,
		// },
		// {
		// 	label: '是否劳务派遣',
		// 	prop: 'laborDispatch',
		// 	propName: 'laborDispatchLabel',
		// 	type: 'remoteSelect',
		// 	code: 'COMMON_FLAG',
		// 	api: 'getDictItemList',
		// 	filterKey: 'value',
		// 	multiple: false,
		// 	rules: [{ required: true, message: '请选择是否劳务派遣' }],
		// 	control: (e, model) => {
		// 		return {
		// 			certificate: {
		// 				display: e == 1,
		// 			},
		// 			certificateStartTime: {
		// 				display: e == 1,
		// 			},
		// 			certificateEndTime: {
		// 				display: e == 1,
		// 			},
		// 			socialSecurityUnit: {
		// 				display: e == 1,
		// 			},
		// 		}
		// 	},
		// 	span: 8,
		// },
		// {
		// 	label: '社保单位',
		// 	prop: 'socialSecurityUnit',
		// 	showWordLimit: true,
		// 	type: 'text',
		// 	span: 8,
		// },
		// {
		// 	label: '劳务派遣证明',
		// 	prop: 'certificate',
		// 	type: 'upload',
		// 	fileType: uploadType.fileMetaType,
		// 	listType: 'text',
		// 	labelPosition: 'top',
		// 	showFileList: true,
		// 	limit: 4,
		// 	multiple: true,
		// 	custome: 'file',
		// 	span: 24,
		// },
		// {
		// 	label: '合同开始时间',
		// 	prop: 'certificateStartTime',
		// 	type: 'date',
		// 	format: 'YYYY年MM月DD日',
		// 	valueFormat: 'YYYY-MM-DD',
		// 	span: 8,
		// 	labelPosition: 'top',
		// 	changeField: true,
		// },
		// {
		// 	label: '合同结束时间',
		// 	prop: 'certificateEndTime',
		// 	type: 'date',
		// 	format: 'YYYY年MM月DD日',
		// 	valueFormat: 'YYYY-MM-DD',
		// 	span: 8,
		// 	labelPosition: 'top',
		// 	changeField: true,
		// },
		{
			type: 'DividerHtml',
			modelValue: '教育背景',
			labelPosition: 'top',
			span: 24,
		},
		{
			label: '文化程度',
			prop: 'cultureDegree',
			propName: 'cultureDegreeLabel',
			type: 'remoteSelect',
			api: 'getDictItemList',
			code: 'EDUCATION_DEGREE',
			rules: [{ required: true, message: '请选择文化程度' }],
			span: 8,
		},
		{
			label: '毕业院校',
			prop: 'graduationInstitution',
			// rules: [{ required: true, message: '请填写毕业院校' }],
			span: 8,
		},
		{
			label: '毕业时间',
			prop: 'graduationTime',
			type: 'date',
			format: 'YYYY年MM月DD日',
			valueFormat: 'YYYY-MM-DD',
			// rules: [{ required: true, message: '请选择毕业时间' }],
			span: 8,
		},
		{
			label: '毕业证书',
			prop: 'graduationCertificate',
			type: 'upload',
			limit: 4,
			// rules: [{ required: true, message: '请上传毕业证书' }],
			span: 8,
		},
		// {
		// 	type: 'DividerHtml',
		// 	modelValue: '工作地点',
		// 	labelPosition: 'top',
		// 	span: 24,
		// },
		// {
		// 	label:'工作机构是否有医疗机构',
		// 	prop:'',
		// 	propName:'',
		// 	type: 'remoteSelect',
		// 	code: 'COMMON_FLAG',
		// 	api: 'getDictItemList',
		// 	span: 8,
		// },
		// {
		// 	label:'工作地点',
		// 	prop:'',
		// 	type:'select',
		// 	dicData:[
		// 		{
		// 			label:"本机构",
		// 			value:""
		// 		},
		// 		{
		// 			label:"内设医疗机构",
		// 			value:""
		// 		}
		// 	],
		// 	span: 8,
		// },
		//--------------------职业资格证书 ----------------
		// {
		// 	type: 'DividerHtml',
		// 	modelValue: '职业资格证书',
		// 	labelPosition: 'top',
		// 	span: 24,
		// },
		// {
		// 	label: '是否持证',
		// 	prop: 'isHold',
		// 	propName: 'isHoldLabel',
		// 	code: 'COMMON_FLAG',
		// 	type: 'remoteSelect',
		// 	api: 'getDictItemList',
		// 	filterKey: 'value',
		// 	multiple: false,
		// 	labelPosition: 'top',
		// 	rules: [{ required: true, message: '请选择是否持证' }],
		// 	span: 8,
		// 	control: (e, model) => {
		// 		return {
		// 			certificateNumber: {
		// 				display: e == 1,
		// 			},
		// 			certificateCategory: {
		// 				display: e == 1,
		// 			},
		// 			otherTypeCertificate: {
		// 				display: e == 1,
		// 			},
		// 			issueUnitName: {
		// 				display: e == 1,
		// 			},
		// 			certificateGrade: {
		// 				display: e == 1,
		// 			},
		// 			certificateMaturity: {
		// 				display: e == 1,
		// 			},
		// 			certificatePhoto: {
		// 				display: e == 1,
		// 			},
		// 		}
		// 	},
		// },
		// {
		// 	label: '证书编号',
		// 	prop: 'certificateNumber',
		// 	maxlength: '50',
		// 	showWordLimit: true,
		// 	type: 'text',
		// 	changeField: true,
		// 	labelPosition: 'top',
		// 	span: 8,
		// },
		// {
		// 	label: '证书类别',
		// 	prop: 'certificateCategory',
		// 	propName: 'certificateCategoryLabel',
		// 	type: 'remoteSelect',
		// 	code: 'CERTIFICATE_CATEGORY',
		// 	api: 'getDictItemList',
		// 	filterKey: 'value',
		// 	multiple: false,
		// 	changeField: true,
		// 	labelPosition: 'top',
		// 	span: 8,
		// },
		// {
		// 	label: '其他类型证书名称',
		// 	prop: 'otherTypeCertificate',
		// 	maxlength: '50',
		// 	showWordLimit: true,
		// 	type: 'text',
		// 	changeField: true,
		// 	labelPosition: 'top',
		// 	span: 8,
		// },
		// {
		// 	label: '颁发单位名称',
		// 	prop: 'issueUnitName',
		// 	maxlength: '50',
		// 	showWordLimit: true,
		// 	type: 'text',
		// 	changeField: true,
		// 	labelPosition: 'top',
		// 	span: 8,
		// },
		// {
		// 	label: '证书等级',
		// 	prop: 'certificateGrade',
		// 	maxlength: '50',
		// 	showWordLimit: true,
		// 	type: 'text',
		// 	changeField: true,
		// 	labelPosition: 'top',
		// 	span: 8,
		// },

		// {
		// 	label: '职业证书到期时间',
		// 	prop: 'certificateMaturity',
		// 	type: 'date',
		// 	format: 'YYYY年MM月DD日',
		// 	valueFormat: 'YYYY-MM-DD',
		// 	span: 8,
		// 	labelPosition: 'top',
		// 	changeField: true,
		// },
		// {
		// 	uploadTip: '证书照片',
		// 	label: '证书照片',
		// 	prop: 'certificatePhoto',
		// 	type: 'upload',
		// 	labelPosition: 'top',
		// 	custome: 'file',
		// 	showFileList: false,
		// 	limit: 1,
		// 	multiple: false,
		// 	changeField: true,
		// 	span: 16,
		// },
		//--------------------执业注册证书 ----------------
		// {
		// 	type: 'DividerHtml',
		// 	modelValue: '执业注册证书',
		// 	labelPosition: 'top',
		// 	span: 24,
		// },
		// {
		// 	label: '是否持证',
		// 	prop: 'registrationCertificate',
		// 	propName: 'registrationCertificateLabel',
		// 	code: 'COMMON_FLAG',
		// 	type: 'remoteSelect',
		// 	api: 'getDictItemList',
		// 	filterKey: 'value',
		// 	multiple: false,
		// 	labelPosition: 'top',
		// 	rules: [{ required: true, message: '请选择是否持证' }],
		// 	span: 8,
		// 	control: (e, model) => {
		// 		return {
		// 			registrationCertificateNumber: {
		// 				display: e == 1,
		// 			},
		// 			registrationCertificateType: {
		// 				display: e == 1,
		// 			},
		// 			otherCertificateName: {
		// 				display: e == 1,
		// 			},
		// 			registrationCertificatePlace: {
		// 				display: e == 1,
		// 			},
		// 			registrationCertificateLevel: {
		// 				display: e == 1,
		// 			},
		// 			expirationTime: {
		// 				display: e == 1,
		// 			},
		// 			registrationCertificatePhoto: {
		// 				display: e == 1,
		// 			},
		// 		}
		// 	},
		// },
		// {
		// 	label: '证书编号',
		// 	prop: 'registrationCertificateNumber',
		// 	maxlength: '50',
		// 	showWordLimit: true,
		// 	type: 'text',
		// 	changeField: true,
		// 	labelPosition: 'top',
		// 	span: 8,
		// },
		// {
		// 	label: '证书类别',
		// 	prop: 'registrationCertificateType',
		// 	propName: 'registrationCertificateTypeLabel',
		// 	type: 'remoteSelect',
		// 	code: 'CERTIFICATE_CATEGORY',
		// 	api: 'getDictItemList',
		// 	filterKey: 'value',
		// 	multiple: false,
		// 	changeField: true,
		// 	labelPosition: 'top',
		// 	span: 8,
		// },
		// {
		// 	label: '其他类型证书名称',
		// 	prop: 'otherCertificateName',
		// 	maxlength: '50',
		// 	showWordLimit: true,
		// 	type: 'text',
		// 	changeField: true,
		// 	labelPosition: 'top',
		// 	span: 8,
		// },
		// {
		// 	label: '注册地',
		// 	prop: 'registrationCertificatePlace',
		// 	maxlength: '50',
		// 	showWordLimit: true,
		// 	type: 'text',
		// 	changeField: true,
		// 	labelPosition: 'top',
		// 	span: 8,
		// },
		// {
		// 	label: '证书等级',
		// 	prop: 'registrationCertificateLevel',
		// 	maxlength: '50',
		// 	showWordLimit: true,
		// 	type: 'text',
		// 	changeField: true,
		// 	labelPosition: 'top',
		// 	span: 8,
		// },

		// {
		// 	label: '职业证书到期时间',
		// 	prop: 'expirationTime',
		// 	type: 'date',
		// 	format: 'YYYY年MM月DD日',
		// 	valueFormat: 'YYYY-MM-DD',
		// 	span: 8,
		// 	labelPosition: 'top',
		// 	changeField: true,
		// },
		// {
		// 	uploadTip: '证书照片',
		// 	label: '证书照片',
		// 	prop: 'registrationCertificatePhoto',
		// 	type: 'upload',
		// 	labelPosition: 'top',
		// 	custome: 'file',
		// 	showFileList: false,
		// 	limit: 1,
		// 	multiple: false,
		// 	changeField: true,
		// 	span: 16,
		// },
		//--------------------健康证 ----------------
		{
			type: 'DividerHtml',
			modelValue: '健康证',
			labelPosition: 'top',
			span: 24,
			prop: 'proofTip',
		},
		{
			uploadTip: '健康证',
			prop: 'proofImg',
			type: 'upload',
			labelPosition: 'top',
			custome: 'file',
			showFileList: false,
			limit: 1,
			multiple: false,
			changeField: true,
			rules: [{ required: true, message: '请上传健康证' }],
			span: 24,
		},
		{
			label: '健康证明颁发单位名称',
			prop: 'proofIssueUnitName',
			maxlength: '50',
			showWordLimit: true,
			type: 'text',
			changeField: true,
			span: 8,
		},
		{
			label: '健康证明类别',
			prop: 'proofType',
			propName: 'proofTypeLabel',
			type: 'remoteSelect',
			code: 'PROOF_TYPE',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			changeField: true,
			span: 8,
		},
		{
			label: '健康证到期时间',
			prop: 'maturityTime',
			type: 'date',
			format: 'YYYY年MM月DD日',
			valueFormat: 'YYYY-MM-DD',
			span: 8,
			changeField: true,
			rules: [{ required: true, message: '请选择健康证到期时间' }],
		},
	],
}

export const ExtendDetailConfig = {
	label: '扩展信息',
	prop: 'practitioners_extend',
	inline: false,
	showBtn: false,
	labelPosition: 'top',
	column: [
		//--------------------社会职务 ----------------
		{
			type: 'DividerHtml',
			modelValue: '社会职务',
			labelPosition: 'top',
			span: 24,
		},
		{
			label: '',
			type: 'dynamic',
			prop: 'dp_foundation_social_title',
			span: 24,
			tabType: 'table',
			custome: 'table',
			column: [
				{
					label: '类型',
					prop: 'jobTypeLabel',
					type: 'input',
					span: 8,
				},
				{
					label: '照片',
					uploadTip: '照片',
					prop: 'photo',
					type: 'upload',
					labelPosition: 'top',
					custome: 'file',
					showFileList: false,
					limit: 1,
					multiple: false,
					changeField: false,
					span: 24,
				},
				{
					label: '开始日期',
					prop: 'startTime',
					type: 'date',
					format: 'YYYY年MM月DD日',
					valueFormat: 'YYYY-MM-DD',
					span: 8,
				},
				{
					label: '任期',
					prop: 'tenure',
					type: 'year',
					format: 'YYYY年',
					valueFormat: 'YYYY',
					span: 8,
				},
			],
		},
	],
}
// 扩展
export const ExtendFormConfig = {
	label: '扩展信息',
	prop: 'practitioners_extend',
	inline: false,
	showBtn: false,
	labelPosition: 'top',
	column: [
		//--------------------从业经历 ----------------
		{
			type: 'DividerHtml',
			modelValue: '从业经历(以往+当前)',
			labelPosition: 'top',
			required: true,
			span: 24,
		},
		{
			label: '',
			type: 'dynamicForm',
			// type: 'dynamic',
			prop: 'dp_practitioners_experience',
			span: 24,
			tabType: 'form',
			config: {
				inline: false,
				showBtn: false,
				labelPosition: 'top',
				maxHeight: '30rem',
				addBtn: true,
				delBtn: true,
			},
			column: [
				{
					label: '所属单位',
					prop: 'belongUnit',
					maxlength: '50',
					showWordLimit: true,
					type: 'text',
					span: 8,
				},
				{
					label: '所在城市',
					prop: 'city',
					span: 8,
				},
				{
					label: '所属单位统一信用代码',
					prop: 'creditCode',
					maxlength: '18',
					showWordLimit: true,
					type: 'text',
					span: 8,
				},
				{
					label: '岗位类型',
					prop: 'postType',
					propName: 'postTypeLabel',
					type: 'remoteSelect',
					code: 'POSITION_TYPE',
					api: 'getDictItemList',
					filterKey: 'value',
					multiple: false,
					custome: 'tag',
					span: 8,
					control: (e) => {
						return {
							otherPost: {
								display: e == 5,
							},
						}
					},
				},
				{
					label: '其他岗位类型名称',
					prop: 'otherPost',
					maxlength: '140',
					showWordLimit: true,
					type: 'text',
					span: 8,
				},
				{
					label: '职业类型',
					prop: 'jobType',
					propName: 'jobTypeLabel',
					type: 'remoteSelect',
					code: 'OCCUPATION_TYPE',
					api: 'getDictItemList',
					filterKey: 'value',
					multiple: true,
					custome: 'tag',
					span: 8,
				},

				{
					label: '参加工作日期',
					prop: 'workDate',
					type: 'date',
					format: 'YYYY年MM月DD日',
					valueFormat: 'YYYY-MM-DD',
					span: 8,
				},
				{
					label: '服务人员聘用方式',
					prop: 'hireMode',
					propName: 'hireModeLabel',
					type: 'remoteSelect',
					code: 'HIRE_MODE',
					api: 'getDictItemList',
					filterKey: 'value',
					multiple: false,
					custome: 'tag',
					span: 8,
				},
				{
					label: '入职日期',
					prop: 'entryDate',
					type: 'date',
					format: 'YYYY年MM月DD日',
					valueFormat: 'YYYY-MM-DD',
					span: 8,
				},
				{
					label: '离职/退休日期',
					prop: 'dimissionDate',
					type: 'date',
					format: 'YYYY年MM月DD日',
					valueFormat: 'YYYY-MM-DD',
					span: 8,
				},
				{
					label: '离职原因说明',
					prop: 'dimissionCause',
					maxlength: '140',
					showWordLimit: true,
					type: 'text',
					span: 8,
				},
				{
					label: '劳动合同',
					prop: 'laborContract',
					type: 'upload',
					limit: 4,
					fileType: uploadType.fileMetaType,
					span: 24,
				},
				{
					label: '离职证明',
					prop: 'dimissionProve',
					type: 'upload',
					limit: 4,
					fileType: uploadType.fileMetaType,
					span: 24,
				},
				// {
				// 	label: '工作内容',
				// 	prop: 'workContent',
				// 	maxlength: '140',
				// 	showWordLimit: true,
				// 	type: 'text',
				// 	span: 8,
				// },
			],
		},
		//--------------------培训记录 ----------------
		{
			type: 'DividerHtml',
			modelValue: '培训记录',
			labelPosition: 'top',
			span: 24,
		},
		{
			label: '',
			type: 'dynamicForm',
			prop: 'dp_training_record',
			span: 24,
			tabType: 'form',
			config: {
				inline: false,
				showBtn: false,
				labelPosition: 'top',
				maxHeight: '30rem',
				addBtn: true,
				delBtn: true,
			},
			column: [
				{
					label: '组织单位',
					prop: 'unitName',
					maxlength: '140',
					showWordLimit: true,
					type: 'text',
					span: 8,
				},
				{
					label: '培训单位名称',
					prop: 'trainingUnitName',
					maxlength: '50',
					showWordLimit: true,
					type: 'text',
					span: 8,
				},
				{
					label: '培训日期',
					prop: 'trainingDate',
					type: 'date',
					format: 'YYYY年MM月DD日',
					valueFormat: 'YYYY-MM-DD',
					span: 8,
				},
				{
					label: '培训内容',
					prop: 'trainingContent',
					maxlength: '140',
					showWordLimit: true,
					type: 'text',
					span: 8,
				},
				{
					label: '培训类型',
					prop: 'trainingType',
					propName: 'trainingTypeLabel',
					type: 'remoteSelect',
					code: 'TRAINING_TYPE',
					api: 'getDictItemList',
					filterKey: 'value',
					multiple: false,
					custome: 'tag',
					span: 8,
				},
				{
					label: '培训天数',
					prop: 'trainingDays',
					changeField: false,
					type: 'input',
					isNum: true,
					append: '天',
					rules: [{ pattern: /^[0-9]*$/, message: '请输入正确的数量' }],
					span: 8,
				},
			],
		},
		//--------------------享受补贴信息 ----------------
		{
			type: 'DividerHtml',
			modelValue: '享受补贴信息',
			labelPosition: 'top',
			span: 24,
		},
		{
			label: '',
			type: 'dynamic',
			prop: 'dp_subsidy_info',
			span: 24,
			tabType: 'table',
			column: [
				{
					label: '补贴类型',
					prop: 'subsidyType',
					maxlength: '50',
					showWordLimit: true,
					type: 'text',
					span: 8,
				},
				{
					label: '补贴标准',
					prop: 'subsidyStandard',
					maxlength: '50',
					showWordLimit: true,
					type: 'text',
					span: 8,
				},
				{
					label: '补贴金额',
					prop: 'subsidyAmount',
					append: '元',
					isNum: true,
					rules: [
						{ required: true, message: '请输入补贴金额' },
						{ pattern: regularRule.fixedTwoNum, message: '请输入正确的金额' },
					],
					type: 'input',
					span: 8,
				},
				{
					label: '补贴标准补贴年限',
					prop: 'subsidyDate',
					type: 'select',
					dicData: [
						{ label: '第一年', value: '第一年' },
						{ label: '第二年', value: '第二年' },
						{ label: '第三年', value: '第三年' },
						{ label: '第四年', value: '第四年' },
					],
					span: 8,
				},
			],
		},
		//--------------------奖/处罚信息 ----------------
		{
			type: 'DividerHtml',
			modelValue: '奖/处罚信息',
			labelPosition: 'top',
			span: 24,
		},
		{
			label: '',
			type: 'dynamic',
			prop: 'dp_reward_punishment_info',
			tabType: 'table',
			span: 24,
			// tabType: 'form',
			// config: {
			// 	inline: false,
			// 	showBtn: false,
			// 	labelPosition: 'top',
			// 	maxHeight: '30rem',
			// 	addBtn: true,
			// 	delBtn: true,
			// },
			column: [
				{
					label: '奖惩层级',
					prop: 'punishmentLevel',
					propName: 'punishmentLevelLabel',
					type: 'remoteSelect',
					code: 'PUNISHMENT_LEVEL',
					api: 'getDictItemList',
					filterKey: 'value',
					multiple: false,
					custome: 'dict',
					dataType: 'string',
					span: 8,
				},
				{
					label: '奖惩类型',
					prop: 'rewardState',
					propName: 'rewardStateLabel',
					type: 'remoteSelect',
					code: 'REWARD_STATE',
					api: 'getDictItemList',
					filterKey: 'value',
					multiple: false,
					custome: 'dict',
					dataType: 'string',
					span: 8,
				},
				{
					label: '日期',
					prop: 'punishmentDate',
					type: 'date',
					format: 'YYYY年MM月DD日',
					valueFormat: 'YYYY-MM-DD',
					span: 8,
				},
				// {
				// 	label: '原因',
				// 	prop: 'punishmentCause',
				// 	maxlength: '140',
				// 	showWordLimit: true,
				// 	type: 'text',
				// 	span: 8,
				// },
				// {
				// 	label: '内容',
				// 	prop: 'punishmentContent',
				// 	maxlength: '140',
				// 	showWordLimit: true,
				// 	type: 'text',
				// 	span: 8,
				// },
				// {
				// 	label: '单位名称',
				// 	prop: 'punishmentUnitName',
				// 	maxlength: '50',
				// 	showWordLimit: true,
				// 	type: 'text',
				// 	span: 8,
				// },
			],
		},
		//--------------------社会职务 ----------------
		{
			type: 'DividerHtml',
			modelValue: '社会职务',
			labelPosition: 'top',
			span: 24,
		},
		{
			label: '',
			type: 'dynamic',
			prop: 'dp_foundation_social_title',
			span: 24,
			tabType: 'table',
			custome: 'table',
			column: [
				{
					label: '类型',
					prop: 'jobTypeLabel',
					type: 'input',
					span: 8,
				},
				{
					label: '照片',
					uploadTip: '照片',
					prop: 'photo',
					type: 'upload',
					labelPosition: 'top',
					custome: 'file',
					showFileList: false,
					limit: 1,
					multiple: false,
					changeField: false,
					span: 24,
				},
				{
					label: '开始日期',
					prop: 'startTime',
					type: 'date',
					format: 'YYYY年MM月DD日',
					valueFormat: 'YYYY-MM-DD',
					span: 8,
				},
				{
					label: '任期',
					prop: 'tenure',
					type: 'year',
					format: 'YYYY年',
					valueFormat: 'YYYY',
					span: 8,
				},
			],
		},
		{
			type: 'DividerHtml',
			modelValue: '安全员持证信息',
			labelPosition: 'top',
			span: 24,
		},
		{
			label: '是否持有安全员相关证书',
			prop: 'isHoldSafeCertificate',
			propName: 'isHoldSafeCertificateLabel',
			type: 'remoteSelect',
			code: 'COMMON_FLAG',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},
		{
			label: '报考工种名称',
			prop: 'safeJobApplication',
			type: 'input',
			span: 8,
		},
		{
			label: '职业方向名称',
			prop: 'safeCareerPath',
			type: 'input',
			span: 8,
		},
		{
			label: '职业等级名称',
			prop: 'safeJobLevel',
			type: 'input',
			span: 8,
		},
		{
			label: '证书编号',
			prop: 'safeCertificateId',
			type: 'input',
			span: 8,
		},
		{
			label: '获证时间',
			prop: 'safeCertificateDate',
			type: 'date',
			format: 'YYYY年MM月DD日',
			valueFormat: 'YYYY-MM-DD',
			span: 8,
		},
		{
			label: '证书到期时间',
			prop: 'safeCertificateExpireDate',
			type: 'date',
			format: 'YYYY年MM月DD日',
			valueFormat: 'YYYY-MM-DD',
			span: 8,
		},
	],
}

export const detailConfig = {
	inline: false,
	showBtn: false,
	labelPosition: 'left',
	column: [...BaseFormConfig.column],
	customeHeader: {
		integrityConfig: {
			baseTableName: 'dp_foundation_practitioners_home',
			materialTableName: 'dp_foundation_practitioners_material',
			soleValue: 'idCard',
		},
		type: 'CardTwo',
		title: 'practitionersName',
		avatar: 'staffPhoto',
		tipList: [{ prop: 'phone', type: 'tip-success', label: '联系电话' }],
		tagList: [
			{ prop: 'workTypeLabel', code: 'WORK_TYPE', custome: 'tag', type: 'success', label: '工作类型' },
			{ prop: 'serviceStateLabel', code: 'SERVICE_STATE', custome: 'tag', type: 'success', label: '服务状态' },
		],
		menuBtn: [
			{
				icon: 'delete',
				label: '删除从业人员',
				type: 'danger',
				operate: 'delete',
				auth: 'view_dpFoundationPractitionersHome_del',
				text: false,
				show: true,
				plain: true,
			},
		],
	},
}

const tableConfig = {
	stripe: true,
	border: true,
	maxHeight: '80vh',
	columns: [
		{ label: '身份证号', prop: 'idCard', plusXing: '2,2' },
		{ label: '姓名', prop: 'practitionersName' },
		{ label: '联系方式', prop: 'phone', plusXing: '5,2' },
		{
			label: '专职',
			prop: 'workTypeLabel',
			span: 8,
		},

		{
			label: '职业类型',
			prop: 'occupationTypeLabel',
		},
		{
			label: '文化程度',
			prop: 'cultureDegreeLabel',
		},
		// {
		// 	label: '是否持证',
		// 	prop: 'isHold',
		// 	custome: 'tag',
		// 	dicData: [
		// 		{ label: '已持证', value: 1, type: 'success' },
		// 		{ label: '未持证', value: 0, type: 'info' },
		// 	],
		// 	span: 8,
		// },
		// {
		// 	label: '证件名称',
		// 	prop: 'certificateName',
		// },
		{
			label: '在职状态',
			prop: 'serviceStateLabel',
			span: 8,
		},
		{ label: '入库时间', prop: 'createTime' },
		{
			label: '上链状态',
			prop: 'onBlockchainFlag',
			api: 'geiDictItemList',
			type: 'remoteSelect',
			code: 'BLOCK_CHAIN_STATUS',
			tipProp: 'onBlockchainTime',
			tipLabel: '上链时间',
		},
		{ label: '材料完整度', prop: 'integrity' },
		{
			label: '操作',
			prop: 'menu',
			width: 200,
			fixed: 'right',
		},
	],
}
let moreSearchConfig: any = {
	inline: true,
	showBtn: false,
	labelPosition: 'left',
	column: [...configToSearch(BaseFormConfig.column)],
}
let reserveSearchConfig: any = {
	inline: true,
	showBtn: false,
	labelPosition: 'left',
	column: [...configToReserveSearch(BaseFormConfig.column)],
}
export const api = {
	moreSearch: 'view_dpFoundationPractitioners_search',
	reserveSearch: 'view_dpFoundationPractitioners_search',
	index: 'view_dpFoundationPractitionersHome_page',
	count: 'view_dpFoundationPractitionersHome_pageCount',
	add: 'view_dpFoundationPractitionersHome_gather',
	edit: 'view_dpDataChange_add',
	detail: 'view_dpFoundationPractitionersHome_view',
	delete: 'view_dpFoundationPractitionersHome_del',
	import: 'view_dpFoundationPractitionersHome_import',
	export: 'view_dpFoundationPractitionersHome_exportAll',
}

export const searchConfig = {
	inline: true,
	showBtn: true,
	labelPosition: 'left',
	column: [
		{
			label: '单位所属区',
			prop: 'unitAreas',
			regionGrade: 3,
			checkStrictly: false,
			type: 'AplidAreaSelect',
			span: 8,
		},
		{
			label: '证件号码',
			prop: 'idCard',
			type: 'input',
			span: 8,
		},
		{
			label: '姓名',
			prop: 'practitionersName',
			type: 'input',
			span: 8,
		},
		{
			label: '联系方式',
			prop: 'phone',
			type: 'input',
			span: 8,
		},
		{
			label: '职业类型',
			prop: 'occupationType',
			type: 'remoteSelect',
			code: 'OCCUPATION_TYPE',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: true,
			span: 8,
		},
		{
			label: '文化程度',
			prop: 'cultureDegree',
			type: 'remoteSelect',
			code: 'EDUCATION_DEGREE',
			api: 'getDictItemList',
			filterKey: 'value',
			multiple: false,
			span: 8,
		},
	],
}

export const baseConfig = {
	pageName: '养老从业人员',
	rowKey: 'id',
	addLabel: '采集数据',
	tipLabel: 'practitionersName',
	needPigeonhole: true, // 是否显示顶部关于归档的部分
	dictcodes: [
		'LEAVEMANAGEMENT_LEAVE_TYPE',
		'BLOCK_CHAIN_STATUS',
		'JOB_TYPE',
		'punishmentLevel',
		'TRAINING_TYPE',
		'OCCUPATION_TYPE',
		'POSITION_TYPE',
		'REWARD_STATE',
		'HIRE_MODE',
		'WORK_TYPE',
		'HEALTHY_STATE',
		'NATURE',
		'SERVICE_STATE',
		'COMMON_FLAG',
		'ID_CARD_TYPE',
		'NATIONALITY',
		'POLITICAL_STATUS',
		'EDUCATION_DEGREE',
		'MARITAL_STATUS',
		'MARITAL_STATUS',
		'OCCUPATION_TYPE',
		'CERTIFICATE_CATEGORY',
		'PROOF_TYPE',
		'STAFF_MATERIAL_TYPE',
	],
	// exportMqTopic: '/ning/export/',
	exportMqTopic: [
		{
			topic: '/ning/export/dpFoundationPractitionersHome/',
			label: '基础数据',
			code: 2007,
			po: 'dpFoundationPractitionersHomePO',
		},
		{
			topic: '/ning/export/dpFoundationPractitionersExtend/',
			label: '扩展信息',
			code: 2008,
			po: 'dpFoundationPractitionersExtendPO',
		},
		{
			topic: '/ning/export/dpPractitionersExperience/',
			label: '从业经历',
			code: 2009,
			po: 'dpPractitionersExperiencePO',
		},
		{
			topic: '/ning/export/dpRewardPunishmentInfo/',
			label: '奖/处罚信息',
			code: 2012,
			po: 'dpRewardPunishmentInfoPO',
		},
		{
			topic: '/ning/export/dpSubsidyInfo/',
			label: '享受补贴信息',
			code: 2011,
			po: 'dpSubsidyInfoPO',
		},
		{
			topic: '/ning/export/dpTrainingRecord/',
			label: '培训记录',
			code: 2010,
			po: 'dpTrainingRecordPO',
		},
	],
	api,
	auth: {
		...api,
		mulitSet: 'mulitSet',
	},
	menuBtn: [
		{
			icon: 'editor',
			label: '查看档案',
			type: 'primary',
			operate: 'Archives',
			auth: api.detail,
			text: true,
			show: true,
		},
	],
	moreSearchConfig,
	reserveSearchConfig,
	dialogConfig: {
		width: '65%',
		// fullscreen: true
	},
	detailConfig,
	searchConfig,
	tableConfig,
	paramsObj: {
		code: 2033,
	},
	beforeOnLoadFormate: async (params) => {
		const unitAreaIds: any = getAreaObj(params.unitAreas, 'unit')
		const unitAreaNames: any = getAreaObj(params.unitAddress, 'unit')
		let dpFoundationPractitionersExtendPO = undefined
		if (params.isHold || params.isHoldLabel) {
			dpFoundationPractitionersExtendPO = {
				isHold: params.isHold,
				isHoldLabel: params.isHoldLabel,
			}
		}
		params = toSearchHandle(moreSearchConfig, reserveSearchConfig, params)
		return Promise.resolve({
			...params,
			...unitAreaIds,
			...unitAreaNames,
			dpFoundationPractitionersExtendPO,
			unitAreas: undefined,
			unitAreasName: undefined,
		})
	},
	onLoadFormate: async (arr) => {
		const tableData = arr.map((item) => {
			const unitAddress: any = getAreaObj(item, 'unit', 'set')
			return {
				...(item.dpFoundationPractitionersExtendPO || {}),
				...item,
				unitAddress: unitAddress.names,
				tableAreaName: [item.unitAreaName, item.unitStreetName, item.unitCommunityName].filter(Boolean).join(''),
			}
		})
		return Promise.resolve(Object.freeze(tableData))
	},
}
